<?php
/**
 * [Fengxu!] (C)2008-2009 SSBT Inc.
 * This is NOT a freeware, use is subject to license terms
 * $Id: syscommon.inc.php Mon Apr 07 02:16:31 GMT 2008 $
 * 
 * @author fengxu qq:250484464 <zhiming0824@163.com> 
 * @version $Id 02:16:31$
 * @license fengxu
 */

error_reporting(E_ALL&~E_NOTICE&~E_WARNING);

define('MCC_ROOT', dirname(__FILE__));

define('IN_MCC', true);

require_once MCC_ROOT . '/include/global.inc.php';

$path = explode('/', MCC_ROOT);
for($i = 0;$i < count($path)-1;$i++) {
	$result[] = $path[$i];
} 
$realpath = implode('/', $result); //Get NetRootDir

include $realpath . '/config.php';

$PHP_SELF=$_SERVER['REQUEST_URI']?$_SERVER['REQUEST_URI']:$PHP_SELF_TEMP;
$HTTP_HOST=$_SERVER['HTTP_HOST']?$_SERVER['HTTP_HOST']:$HTTP_SERVER_VARS['HTTP_HOST'];
$WEBURL='http://'.$HTTP_HOST.$PHP_SELF;
$truepath=preg_replace("/(.+)\/([^\/]+)\/([^\/]+)/is","\\1",$WEBURL);

$action=$_POST['action'];

if ('edit' == $action) {
	foreach($_POST as $key => $value){
		$webdbs[$key]=$value;
	}
	$ip_info = "\$webdbs['webname']='".$webdbs[webname]."';\n\$webdbs['weburl']='".$webdbs[weburl]."';\n\$webdbs['weblogo']='".$webdbs[weblogo]."';\n\$webdbs['metakeywords']='".$webdbs[metakeywords]."';\n\$webdbs['webmail']='".$webdbs[webmail]."';\n";
	$filename = $realpath . '/config.php';
	$fp = fopen($filename, 'wb+');
	if ($fp) {
		$str = "<?php\n" . $ip_info . "?>";
		fwrite($fp, $str);
		fclose($fp);
	} 
	adminmsg('Modify Success', 'config_set.inc.php');
} 

include_once MCC_ROOT . '/templates/msystem/setnet.htm';



?>